public class CustomerPortalNewCaseExtension { 

    private ApexPages.StandardController controller;
    private Case c;
    public CustomerPortalNewCaseExtension(ApexPages.StandardController controller) {
        this.controller = controller;
    }
    public PageReference viewSuggestionSave() {
        controller.save();
        c = (Case)controller.getRecord();
        return new PageReference('/ui/solution/SolutionSuggestionPage?caseid=' + c.Id + '&autoredirected=1');
    }
    public PageReference viewSuggestionSaveAdd() {
        controller.save();
        c = (Case)controller.getRecord();
        return new PageReference('/p/attach/NoteAttach?pid=' + c.Id + '&retURL=/ui/solution/SolutionSuggestionPage?caseid=' + c.Id + '&autoredirected=1');
    }
    static testMethod void testCustomerPortalNewCaseExtension() {
        Case testCase = new Case();
        testCase.Subject = 'Test Subject';
        testCase.Priority = 'Medium';
        testCase.Description = 'Test Description';
        insert testCase;
        
        ApexPages.StandardController caseController = new ApexPages.standardController(testCase);
        CustomerPortalNewCaseExtension caseExt = new CustomerPortalNewCaseExtension(caseController);
        PageReference theRef = caseExt.viewSuggestionSave();
        System.AssertEquals('/ui/solution/SolutionSuggestionPage?autoredirected=1&caseid=' + testCase.Id,theRef.getUrl());
        
        theRef = caseExt.viewSuggestionSaveAdd();
        System.AssertEquals('/p/attach/NoteAttach?autoredirected=1&pid=' + testCase.Id + '&retURL=%2Fui%2Fsolution%2FSolutionSuggestionPage%3Fcaseid%3D' + testCase.Id,theRef.getUrl());

    }
 }